package com.jbm.jsm.iface;

import com.jbm.core.iface.IAcross;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created by Administrator on 2017/9/26.
 */
@Entity
@Table(name = "arbitrate_info", schema = "", catalog = "jsm")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ArbitrateInfoEntity extends IAcross
{
    public ArbitrateInfoEntity()
    {
        super();
    }

    public ArbitrateInfoEntity(IAcross ia)
    {
        super(ia);
    }

    private int aiId;
    private String memo;
    private Integer compensSeller;
    private Integer compensUser;
    private Integer createId;
    private Timestamp createDate;
    private List<ArbitrateInfoEntity> arbitrateInfoList;

    @Id
    @Column(name = "ai_id")
    @GeneratedValue
    public int getAiId() {
        return aiId;
    }

    public void setAiId(int aiId) {
        this.aiId = aiId;
    }

    @Basic
    @Column(name = "memo")
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "compens_seller")
    public Integer getCompensSeller() {
        return compensSeller;
    }

    public void setCompensSeller(Integer compensSeller) {
        this.compensSeller = compensSeller;
    }

    @Basic
    @Column(name = "compens_user")
    public Integer getCompensUser() {
        return compensUser;
    }

    public void setCompensUser(Integer compensUser) {
        this.compensUser = compensUser;
    }

    @Basic
    @Column(name = "create_id")
    public Integer getCreateId() {
        return createId;
    }

    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ArbitrateInfoEntity that = (ArbitrateInfoEntity) o;

        if (aiId != that.aiId) return false;
        if (compensSeller != null ? !compensSeller.equals(that.compensSeller) : that.compensSeller != null)
            return false;
        if (compensUser != null ? !compensUser.equals(that.compensUser) : that.compensUser != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (createId != null ? !createId.equals(that.createId) : that.createId != null) return false;
        if (memo != null ? !memo.equals(that.memo) : that.memo != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = aiId;
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        result = 31 * result + (compensSeller != null ? compensSeller.hashCode() : 0);
        result = 31 * result + (compensUser != null ? compensUser.hashCode() : 0);
        result = 31 * result + (createId != null ? createId.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        return result;
    }

    @Transient
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    public List<ArbitrateInfoEntity> getArbitrateInfoList() {
        return arbitrateInfoList;
    }

    public void setArbitrateInfoList(List<ArbitrateInfoEntity> arbitrateInfoList) {
        this.arbitrateInfoList = arbitrateInfoList;
    }
}
